<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI行程制定 - 退役军人服务平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #1a6df0;
            --navy-blue: #0d2b50;
            --secondary: #ff6b00;
            --light-bg: #f5f7fa;
            --white: #ffffff;
            --gray: #6c757d;
            --text-primary: #333;
            --text-secondary: #666;
            --border: #e5e5e5;
        }

        body {
            font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
            background: linear-gradient(180deg, #f0f7ff 0%, var(--light-bg) 100%);
            color: var(--text-primary);
            padding-bottom: 100px;
        }

        .header {
            background: linear-gradient(135deg, var(--navy-blue) 0%, var(--primary) 100%);
            color: white;
            padding: 15px 20px;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 4px 20px rgba(13, 43, 80, 0.2);
            border-bottom-left-radius: 20px;
            border-bottom-right-radius: 20px;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header-title {
            font-size: 18px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .header-title::before {
            content: '🎯';
            font-size: 22px;
        }

        /* 进度条 */
        .progress-bar {
            margin: 20px 20px 0;
            background: rgba(255,255,255,0.5);
            border-radius: 50px;
            height: 8px;
            overflow: hidden;
            position: relative;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: 50px;
            transition: width 0.5s ease;
            box-shadow: 0 2px 10px rgba(26, 109, 240, 0.4);
        }

        .progress-steps {
            display: flex;
            justify-content: space-between;
            margin: 15px 20px 0;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .progress-step {
            text-align: center;
            flex: 1;
        }

        .progress-step.active {
            color: var(--primary);
            font-weight: 600;
        }

        /* 步骤容器 */
        .step-container {
            display: none;
            animation: fadeIn 0.3s;
        }

        .step-container.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .step-content {
            margin: 30px 20px;
            text-align: center;
        }

        .step-icon {
            font-size: 64px;
            margin-bottom: 15px;
            animation: bounce 2s ease-in-out infinite;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        .step-question {
            font-size: 22px;
            font-weight: 700;
            color: var(--navy-blue);
            margin-bottom: 10px;
        }

        .step-desc {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 30px;
        }

        /* 选项网格 */
        .options-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .option-card {
            background: white;
            border: 3px solid var(--border);
            border-radius: 20px;
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        }

        .option-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.12);
        }

        .option-card.selected {
            border-color: var(--primary);
            background: linear-gradient(135deg, rgba(26, 109, 240, 0.1), rgba(26, 109, 240, 0.05));
            transform: scale(1.05);
            box-shadow: 0 8px 25px rgba(26, 109, 240, 0.3);
        }

        .option-icon {
            font-size: 36px;
            margin-bottom: 10px;
        }

        .option-label {
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
        }

        /* 文字输入区域 */
        .text-input-section {
            margin-top: 30px;
            padding-top: 30px;
            border-top: 2px dashed var(--border);
        }

        .text-input-toggle {
            background: white;
            border: 2px solid var(--primary);
            border-radius: 50px;
            padding: 12px 24px;
            font-size: 14px;
            font-weight: 600;
            color: var(--primary);
            cursor: pointer;
            transition: all 0.3s;
            margin-bottom: 20px;
        }

        .text-input-toggle:hover {
            background: var(--primary);
            color: white;
        }

        .text-input-area {
            display: none;
            background: white;
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }

        .text-input-area.show {
            display: block;
            animation: slideDown 0.3s;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .text-input {
            width: 100%;
            min-height: 120px;
            padding: 15px;
            border: 2px solid var(--border);
            border-radius: 15px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            transition: border-color 0.3s;
        }

        .text-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .text-input-hint {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 8px;
            text-align: left;
        }

        /* 底部按钮 */
        .action-buttons {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: white;
            padding: 15px 20px;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
            display: flex;
            gap: 10px;
            z-index: 1000;
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
        }

        .btn {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: 15px;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-secondary {
            background: var(--light-bg);
            color: var(--primary);
            border: 2px solid var(--primary);
        }

        .btn-secondary:hover {
            background: var(--primary);
            color: white;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            box-shadow: 0 4px 15px rgba(26, 109, 240, 0.4);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(26, 109, 240, 0.5);
        }

        .btn-primary:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        /* 结果预览 */
        .result-preview {
            margin: 20px;
            background: white;
            border-radius: 20px;
            padding: 25px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            display: none;
        }

        .result-preview.show {
            display: block;
            animation: fadeIn 0.5s;
        }

        .result-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--navy-blue);
            margin-bottom: 20px;
            text-align: center;
        }

        .travel-card {
            border: 2px solid var(--border);
            border-radius: 20px;
            overflow: hidden;
            margin-bottom: 15px;
        }

        .travel-image {
            width: 100%;
            height: 180px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 64px;
        }

        .travel-content {
            padding: 20px;
        }

        .travel-title {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 12px;
        }

        .travel-info {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 10px;
            line-height: 1.6;
        }

        .travel-tags {
            display: flex;
            gap: 8px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .badge {
            padding: 6px 12px;
            border-radius: 15px;
            font-size: 12px;
            font-weight: 600;
            background: #fff3e0;
            color: var(--secondary);
        }

        .travel-price {
            font-size: 24px;
            font-weight: 700;
            color: var(--secondary);
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="header-content">
            <div class="header-title">AI行程制定</div>
            <i class="fas fa-times" style="cursor: pointer;" onclick="history.back()"></i>
        </div>
    </div>

    <!-- 进度条 -->
    <div class="progress-bar">
        <div class="progress-fill" id="progressFill" style="width: 20%;"></div>
    </div>
    <div class="progress-steps">
        <div class="progress-step active" id="step1-label">目的地</div>
        <div class="progress-step" id="step2-label">时间</div>
        <div class="progress-step" id="step3-label">预算</div>
        <div class="progress-step" id="step4-label">偏好</div>
        <div class="progress-step" id="step5-label">完成</div>
    </div>

    <!-- 步骤1: 目的地 -->
    <div class="step-container active" id="step1">
        <div class="step-content">
            <div class="step-icon">🌍</div>
            <div class="step-question">您想去哪里旅行？</div>
            <div class="step-desc">选择一个热门目的地，或输入您的想法</div>
            
            <div class="options-grid" id="destination-options">
                <div class="option-card" data-value="北京">
                    <div class="option-icon">🏛️</div>
                    <div class="option-label">北京</div>
                </div>
                <div class="option-card" data-value="上海">
                    <div class="option-icon">🏙️</div>
                    <div class="option-label">上海</div>
                </div>
                <div class="option-card" data-value="杭州">
                    <div class="option-icon">🏞️</div>
                    <div class="option-label">杭州</div>
                </div>
                <div class="option-card" data-value="西安">
                    <div class="option-icon">🏯</div>
                    <div class="option-label">西安</div>
                </div>
                <div class="option-card" data-value="成都">
                    <div class="option-icon">🐼</div>
                    <div class="option-label">成都</div>
                </div>
                <div class="option-card" data-value="厦门">
                    <div class="option-icon">🏖️</div>
                    <div class="option-label">厦门</div>
                </div>
            </div>

            <div class="text-input-section">
                <button class="text-input-toggle" onclick="toggleTextInput('destination')">
                    <i class="fas fa-edit"></i> 我有其他想法
                </button>
                <div class="text-input-area" id="destination-input">
                    <textarea class="text-input" placeholder="请输入您想去的城市或景点，比如：我想去云南大理看看洱海..."></textarea>
                    <div class="text-input-hint">💡 提示：告诉我更多细节，我能为您定制更合适的行程！</div>
                </div>
            </div>
        </div>
    </div>

    <!-- 步骤2: 时间 -->
    <div class="step-container" id="step2">
        <div class="step-content">
            <div class="step-icon">📅</div>
            <div class="step-question">您计划什么时候出发？</div>
            <div class="step-desc">选择您的出行时间偏好</div>
            
            <div class="options-grid" id="time-options">
                <div class="option-card" data-value="weekend">
                    <div class="option-icon">🎉</div>
                    <div class="option-label">本周末</div>
                </div>
                <div class="option-card" data-value="next-week">
                    <div class="option-icon">📆</div>
                    <div class="option-label">下周</div>
                </div>
                <div class="option-card" data-value="month">
                    <div class="option-icon">🗓️</div>
                    <div class="option-label">本月内</div>
                </div>
                <div class="option-card" data-value="flexible">
                    <div class="option-icon">✨</div>
                    <div class="option-label">时间灵活</div>
                </div>
            </div>

            <div class="text-input-section">
                <button class="text-input-toggle" onclick="toggleTextInput('time')">
                    <i class="fas fa-edit"></i> 我有具体日期
                </button>
                <div class="text-input-area" id="time-input">
                    <textarea class="text-input" placeholder="请输入具体的出行日期，比如：我想在3月20日到3月25日之间出行..."></textarea>
                </div>
            </div>
        </div>
    </div>

    <!-- 步骤3: 预算 -->
    <div class="step-container" id="step3">
        <div class="step-content">
            <div class="step-icon">💰</div>
            <div class="step-question">您的预算范围是？</div>
            <div class="step-desc">每人预算（包含住宿、交通、门票等）</div>
            
            <div class="options-grid" id="budget-options">
                <div class="option-card" data-value="1000-3000">
                    <div class="option-icon">💵</div>
                    <div class="option-label">1000-3000元</div>
                </div>
                <div class="option-card" data-value="3000-5000">
                    <div class="option-icon">💴</div>
                    <div class="option-label">3000-5000元</div>
                </div>
                <div class="option-card" data-value="5000-8000">
                    <div class="option-icon">💶</div>
                    <div class="option-label">5000-8000元</div>
                </div>
                <div class="option-card" data-value="8000+">
                    <div class="option-icon">💷</div>
                    <div class="option-label">8000元以上</div>
                </div>
            </div>

            <div class="text-input-section">
                <button class="text-input-toggle" onclick="toggleTextInput('budget')">
                    <i class="fas fa-edit"></i> 我有详细预算说明
                </button>
                <div class="text-input-area" id="budget-input">
                    <textarea class="text-input" placeholder="请详细说明您的预算情况，比如：预算比较灵活，主要希望能享受到退役军人优惠..."></textarea>
                </div>
            </div>
        </div>
    </div>

    <!-- 步骤4: 偏好 -->
    <div class="step-container" id="step4">
        <div class="step-content">
            <div class="step-icon">❤️</div>
            <div class="step-question">您喜欢什么样的旅行？</div>
            <div class="step-desc">可以选择多个选项哦～</div>
            
            <div class="options-grid" id="preference-options">
                <div class="option-card multi-select" data-value="nature">
                    <div class="option-icon">🏔️</div>
                    <div class="option-label">自然风光</div>
                </div>
                <div class="option-card multi-select" data-value="history">
                    <div class="option-icon">🏛️</div>
                    <div class="option-label">历史文化</div>
                </div>
                <div class="option-card multi-select" data-value="relax">
                    <div class="option-icon">🏖️</div>
                    <div class="option-label">休闲度假</div>
                </div>
                <div class="option-card multi-select" data-value="red-travel">
                    <div class="option-icon">🚩</div>
                    <div class="option-label">红色旅游</div>
                </div>
                <div class="option-card multi-select" data-value="comrade">
                    <div class="option-icon">👥</div>
                    <div class="option-label">战友聚会</div>
                </div>
                <div class="option-card multi-select" data-value="food">
                    <div class="option-icon">🍜</div>
                    <div class="option-label">美食探索</div>
                </div>
            </div>

            <div class="text-input-section">
                <button class="text-input-toggle" onclick="toggleTextInput('preference')">
                    <i class="fas fa-edit"></i> 我有其他特殊需求
                </button>
                <div class="text-input-area" id="preference-input">
                    <textarea class="text-input" placeholder="请详细描述您的旅行偏好和特殊需求，比如：我想和战友一起去，希望能安排一些集体活动..."></textarea>
                </div>
            </div>
        </div>
    </div>

    <!-- 步骤5: 完成 -->
    <div class="step-container" id="step5">
        <div class="step-content">
            <div class="step-icon">🎉</div>
            <div class="step-question">太棒了！信息已收集完成</div>
            <div class="step-desc">AI正在为您定制专属行程，请稍候...</div>
        </div>

        <div class="result-preview show" id="resultPreview">
            <div class="result-title">✨ 为您推荐的行程</div>
            <div class="travel-card">
                <div class="travel-image">🏔️</div>
                <div class="travel-content">
                    <div class="travel-title">北京3日游 - 退役军人专属优惠</div>
                    <div class="travel-info">📍 时间：2024-03-15 至 2024-03-17</div>
                    <div class="travel-info">🎯 包含：天安门广场、故宫、八达岭长城、颐和园等</div>
                    <div class="travel-info">👥 适合：2人出行</div>
                    <div class="travel-tags">
                        <span class="badge">退役军人免费</span>
                        <span class="badge">专属优惠</span>
                        <span class="badge">热门推荐</span>
                    </div>
                    <div class="travel-price">¥2,580/人</div>
                </div>
            </div>
        </div>
    </div>

    <!-- 底部按钮 -->
    <div class="action-buttons">
        <button class="btn btn-secondary" id="prevBtn" onclick="prevStep()" style="display: none;">
            <i class="fas fa-arrow-left"></i> 上一步
        </button>
        <button class="btn btn-primary" id="nextBtn" onclick="nextStep()">
            下一步 <i class="fas fa-arrow-right"></i>
        </button>
    </div>

    <script>
        let currentStep = 1;
        const totalSteps = 5;
        const formData = {
            destination: '',
            time: '',
            budget: '',
            preferences: []
        };

        function updateProgress() {
            const progress = (currentStep / totalSteps) * 100;
            document.getElementById('progressFill').style.width = progress + '%';
            
            // 更新步骤标签
            for (let i = 1; i <= totalSteps; i++) {
                const label = document.getElementById(`step${i}-label`);
                if (i <= currentStep) {
                    label.classList.add('active');
                } else {
                    label.classList.remove('active');
                }
            }
        }

        function showStep(step) {
            // 隐藏所有步骤
            document.querySelectorAll('.step-container').forEach(container => {
                container.classList.remove('active');
            });
            
            // 显示当前步骤
            document.getElementById(`step${step}`).classList.add('active');
            
            // 更新按钮显示
            document.getElementById('prevBtn').style.display = step === 1 ? 'none' : 'block';
            
            if (step === totalSteps) {
                document.getElementById('nextBtn').innerHTML = '<i class="fas fa-check"></i> 完成';
                generateResult();
            } else {
                document.getElementById('nextBtn').innerHTML = '下一步 <i class="fas fa-arrow-right"></i>';
            }
            
            updateProgress();
        }

        function nextStep() {
            if (currentStep < totalSteps) {
                currentStep++;
                showStep(currentStep);
            } else {
                // 完成
                window.scrollTo(0, 0);
            }
        }

        function prevStep() {
            if (currentStep > 1) {
                currentStep--;
                showStep(currentStep);
            }
        }

        function toggleTextInput(type) {
            const inputArea = document.getElementById(`${type}-input`);
            inputArea.classList.toggle('show');
        }

        // 选项点击处理
        document.querySelectorAll('.option-card').forEach(card => {
            card.addEventListener('click', function() {
                const isMultiSelect = this.classList.contains('multi-select');
                
                if (isMultiSelect) {
                    // 多选模式（偏好）
                    this.classList.toggle('selected');
                    const value = this.dataset.value;
                    const index = formData.preferences.indexOf(value);
                    if (index > -1) {
                        formData.preferences.splice(index, 1);
                    } else {
                        formData.preferences.push(value);
                    }
                } else {
                    // 单选模式
                    const parentGrid = this.parentElement;
                    parentGrid.querySelectorAll('.option-card').forEach(c => {
                        c.classList.remove('selected');
                    });
                    this.classList.add('selected');
                    
                    // 保存选择
                    const stepId = parentGrid.id;
                    if (stepId.includes('destination')) {
                        formData.destination = this.dataset.value;
                    } else if (stepId.includes('time')) {
                        formData.time = this.dataset.value;
                    } else if (stepId.includes('budget')) {
                        formData.budget = this.dataset.value;
                    }
                }
            });
        });

        function generateResult() {
            // 模拟生成结果
            setTimeout(() => {
                document.getElementById('resultPreview').classList.add('show');
                window.scrollTo(0, document.body.scrollHeight);
            }, 1000);
        }

        // 初始化
        updateProgress();
    </script>
</body>
</html>